package com.blackcat.dynamicexcel.entity;

import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

import static com.alibaba.fastjson.serializer.SerializerFeature.*;

/**
 * <p>
 * Excel模板
 * </p>
 *
 * @author blackcat
 * @since 2022-12-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@JSONType(ignores = {"id"},serialzeFeatures = {WriteNullStringAsEmpty,WriteNullBooleanAsFalse,WriteNullListAsEmpty})
public class ExcelTemplate extends Model<ExcelTemplate> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 模板名称
     */
    private String name;

    /**
     * 所属功能模块
     */
    private String modelName;

    /**
     * 所属系统模块
     */
    private String systemCode;

    /**
     * 所属公司代码
     */
    private String companyCode;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

    /**
     * excel所有数据页
     */
    @TableField(exist = false)
    private List<ExcelSheet> sheets;


}
